﻿using G19Glower.Shared;

namespace G19Glower.Glowies.DiscoGlower
{
    [GlowerInfo("Disco Mode", "Sets a random colour when you press a key.")]
    internal class DiscoGlowerOverlord : IGlower
    {
        private IServicesProvider mServiceProvider;
        private DiscoGlower mGlower;

        #region IGlower Members

        void IGlower.Initialize(IServicesProvider servicesProvider)
        {
            mServiceProvider = servicesProvider;

            var keyboardService = mServiceProvider.GetService<IKeyboardListener>();
            var glowController = mServiceProvider.GetService<IGlowController>();

            mGlower = new DiscoGlower(glowController, keyboardService);
        }

        void IGlower.Start()
        {
            mGlower.Start();
        }

        void IGlower.Stop()
        {
            mGlower.Stop();
        }

        bool IGlower.IsRunning
        {
            get { return mGlower.IsRunning; }
        }

        #endregion
    }
}
